// tanxing + tongpai
// over
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 100005;

int n, val[MAXN], num[MAXN];

int main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> num[i];
    }
    sort(num + 1, num + 1 + n);
    int cnt = 0;
    for(int i = 1; i <= n; i++){
        if(num[i] != num[i - 1]) cnt++;
        val[cnt]++;
    }
    long long ans = n, tot = 0;
    for(int i = 1; i <= cnt; i++){
        if(val[i] >= val[i - 1] + tot) ans -= (val[i - 1] + tot);
        else {
            ans -= val[i];
            tot += (val[i - 1] - val[i]);
        }
    }
    cout << ans << endl;

    fclose(stdin);
    fclose(stdout);
    return 0;
}
